package com.zjb.demo.system.mapper;

import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.zjb.demo.system.domain.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

import static com.zjb.demo.system.domain.table.SysRoleMenuTableDef.SYS_ROLE_MENU;

/**
 * @author 庄佳彬
 * @since 2023/12/31 12:03
 */
@Mapper
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {
    default void removeByRoleIds(List<Long> list) {
        var query = QueryWrapper.create()
                .where(SYS_ROLE_MENU.ROLE_ID.in(list));
        deleteByQuery(query);
    }
}
